﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using FireBillBook.Core.Models;
using FireBillBook.Core.Entities;
using FireBillBook.Core.Models.QueryContexts;

namespace FireBillBook.Core.Services
{
    public interface IImportService
    {
        /// <summary>
        /// 保存导入文件
        /// </summary>
        /// <param name="dataSource">数据来源平台</param>
        /// <param name="filestream">文件流</param>
        /// <returns></returns>
        Task SaveFile(string dataSource, Stream filestream);

        /// <summary>
        /// 保存文件
        /// </summary>
        /// <param name="model"></param>
        /// <param name="file"></param>
        /// <returns></returns>
        Task<string> SaveFile(UploadPaymentModel model, IFormFile file);

        /// <summary>
        /// 导入数据
        /// </summary>
        /// <param name="filepath"></param>
        /// <returns></returns>
        Task Import(string platform, string filepath);

        Task Import(string platform, IFormFile file);

        Task Import(string platform, Stream fileStream);


        /// <summary>
        /// 导入数据
        /// </summary>
        /// <param name="file">上传的文件</param>
        /// <returns></returns>
        Task<List<Models.OriginalDatas.AliPaymentOriginalData>> GetOriginalDatasOfAliPay(IFormFile file);

            
        /// <summary>
        /// 获取当前上传路径
        /// </summary>
        /// <returns></returns>
        string TryGetUploadPath();

        List<Entities.BillingSourceData> Convert(object originalDatas, string platform);

        Task<PagingModel<BillingSourceData>> ListSourceDataAsync(BillingSourceDataListQueryContext queryContext);
    }
}
